package com.lst.demo.recycleview.adapter;

import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lst.demo.R;
import com.lst.demo.recycleview.bean.PersonBean;

import java.util.List;

/**
 * 网格
 * create by Lst
 * on 2020/4/8
 */
public class ListGvRecycleAdapter extends RecyclerView.Adapter<ListGvRecycleAdapter.ViewHolder> {


    private Context context;
    private List<PersonBean> listdata;

    public ListGvRecycleAdapter(Context context, List<PersonBean> listdata) {
        this.context = context;
        this.listdata = listdata;
    }

    @NonNull
    @Override
    public ListGvRecycleAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_gv, viewGroup, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull ListGvRecycleAdapter.ViewHolder viewHolder, int i) {

    }

    @Override
    public int getItemCount() {
        return listdata.size();
    }


    public class ViewHolder extends RecyclerView.ViewHolder {

        public ViewHolder(View itemView) {
            super(itemView);

        }

    }


}
